<?php

Yii::import('zii.widgets.CPortlet');

class RecentComments extends CPortlet
{
	public $title='Comentarios recentes';
        private $adminName = 'demo';
        public $maxComments=5;
        
        public function getAdmin($username){

            if($username == $this->adminName){
             return TRUE;
            }else{
             return FALSE;
            }
        }

	public function getRecentComments()
	{
		return Comment::model()->findRecentComments($this->maxComments);
	}

	protected function renderContent()
	{
		$this->render('recentComments');
	}
}